package com.example.waitnotify;

/**
 * @author:CrazyShaQiuShi
 * @email:3105334046@qq.com
 * @descript:
 * @version:1.0.0
 */
public class ThreadWait extends Thread {
    private User user;

    public ThreadWait(User user) {
        this.user = user;
    }

    @Override
    public void run() {
        synchronized (user) {
            try {
                user.wait();
                System.out.println(user);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
